import api from "../api";
import type Typings from "@/typings";

export default {
  lifeListApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/list";
    return api.get(url, data, { ...config });
  },

  lifeAddApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/add";
    return api.post(url, data, { ...config, openLoading: true });
  },

  lifeUpdateApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/update";
    return api.post(url, data, { ...config, openLoading: true });
  },

  lifeCheckApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/check";
    return api.get(url, data, { ...config });
  },

  lifeRemoveApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/remove";
    return api.get(url, data, { ...config });
  },

  lifeFinishApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/finish";
    return api.post(url, data, { ...config, openLoading: true });
  },

  lifeSetTopApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/setTop";
    return api.post(url, data, { ...config, openLoading: true });
  },

  lifeBatchApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/life/batch";
    return api.post(url, data, { ...config, openLoading: true });
  },
};
